home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Special 13
/
AMIGAplus Sonderheft 13 (1998)(ICP)(DE)[!].iso
/
rexx
/
flushdatatypes.sirexx
< prev
next >
Wrap
Text File
|
1997-08-28
|
1KB
|
69 lines
/* This will expunge all unused datatypes from memory */
options results
signal on error
address 'INSPECTOR.1'
/* Select the Libs list. */
GetDisplay ; currentdisplay = result
If currentdisplay ~= 5 Then SetDisplay 5
/* We don't want to be bothered with requesters */
GetPrefs Confirm ; oldconfirm = result
if oldconfirm = "ON" Then SetPrefs Confirm OFF
/* browse thru the list until we reach the last item. */
flushed = 0
counter = 0
done = 0
Do while done = 0
SelectNode Num counter ; if result = "ERROR" then done = 1
If done = 0 Then Do
GetNodeInfo 1 ; nodename = result
/* Should this node be flushed? */
If Pos(".datatype",nodename) >0 Then Do
SetStatus "Flushing..."
FlushNode
/* If the node is gone, then the next node was moved one level to the
top - so our next node is on that same position. So, we won't
move down, so next iteration will be on this bubbled-up node. */
GetStatus ; status = result
If Pos("Flushed",status) > 0 Then Do
counter = counter - 1 /* So we do not skip the new one */
flushed = flushed + 1
End
End
counter = counter + 1
End
End
/* Restore the Confirm setting */
SetPrefs Confirm oldconfirm
/* Report */
SetStatus 'Flushed '||flushed||' datatype(s).'